

************************************************
*** Replication files list experiment Russia ***
*** Filipp Chapkovskii, Max Schaub           ***
*** Date of data collection: 4 April 2020    ***
************************************************



*** Setup ***

** Working directory
*   Note: Set working directory and place the dataset in it; then run the code below

cd "[your directory]"  

import excel "data/full_cleaned.xlsx", sheet("Sheet1") firstrow clear


** Packages
ssc install coefplot, replace // thanks to Ben Jann
ssc install scheme-burd, replace // thanks to François Briatte



*** Recoding ***

** Demographics
gen age = playerage
gen over40 = 1 if age>=40 & age!=. 
replace over40 = 0 if age<40 
label define over40 0 "under 40" 1 "40 and over", replace
label values over40 over40
gen male = 1 if playergender==0
replace male = 0 if playergender==1
label define male 0 "female" 1 "male", replace
label values male male
gen edu = playereducation
label define edu 0 "High school (including incomplete)" 1 "Secondary vocational education" /// 
	2 "Incomplete higher education" 3 "Higher education" 4 "Two or more degrees", replace
label values edu edu
gen someuni = 1 if edu>1 & edu!=.
replace someuni = 0 if edu<=1
label define someuni 0 "No university" 1 "Some university", replace
label values someuni someuni
gen citysize = playercity_size
label define citysize 1 "< 2,000" 2 "2,000 - 5,000" 3 "5,001- 10,000" 4 "10,001 - 20,000" ///
	5 "20,001 - 50,000" 6 "50,001 - 100,000" 7 "100,001 - 500,000" 8 "> 500,000 - 1 mio" ///
    9 "1 mio and more", replace
label values citysize citysize	
recode citysize (1/7 = 0 "Under 500k") (8/9 = 1 "500k +"), gen(city500k)
** Risk attitudes
gen riskaverse = 1 if playergeneral_risk<6
replace riskaverse = 0 if playergeneral_risk>=6 & playergeneral_risk!=.
label define riskaverse 0 "Likes risk" 1 "Risk averse", replace
label values riskaverse riskaverse
** Treatment status 
gen treat = 1 if playertreatment=="treatment"
replace treat = 0 if playertreatment=="baseline"
** Nr of supported items
gen nlist = playermain
** Direct question: personal support for invasion
gen directq = playerdirect



*** Analysis ***


*** Exclude individuals who did not pass the attention question
drop if playerpayable!=1



*** Tables

** Table 1
*   Note: Census data from 
*   https://www.gks.ru/free_doc/new_site/perepis2010/croc/Documents/Vol3/pub-03-01.xlsx
*   and 
*   https://www.gks.ru/free_doc/new_site/perepis2010/croc/Documents/Vol1/pub-01-06.xlsx

tabstat male over40 someuni city500k, stat(mean n)



*** Plots

** Figure 2

reg nlist treat 
eststo qexperiment: margins, dydx(treat) post coefl
eststo qdirect: reg directq 

coefplot qexperiment qdirect, ///
					name(maineffects, replace) ///
					title("", margin(medlarge)) legend(off) vertical recast(bar) barwidth(0.75) fcolor(*1.5) ///
					ciopts(recast(rcap) lwidth(medthick)) citop format(%9.0f) scheme(burd8) yline(0, lpattern(solid)) ///
					coeflabels(treat = "List experiment" _cons = "Direct question") ///
					ytitle("Support for invasion", size(medlarge)) xtitle("") ///
					yscale(range(0.3 (.1) .8)) ylab(0.3 (.1) .8, format(%9.1f))
graph display , ysize(1) xsize(1) scale(1) 

** Figure 3

reg nlist c.treat##i.riskaverse 
eststo qexpriskaverse: margins, dydx(treat) by(riskaverse) post coefl
reg directq i.riskaverse 
eststo qdirriskaverse: margins riskaverse, post coefl

coefplot (qexpriskaverse, label("List experiment")) (qdirriskaverse, label("Direct question")), ///
					name(condeffects, replace) ///
					title("", margin(medlarge)) vertical recast(bar) barwidth(0.28) fcolor(*1.5) ///
					ciopts(recast(rcap) lwidth(medium)) citop format(%9.0f) scheme(burd8) yline(0, lpattern(solid)) ///
					ytitle("Support for invasion", size(medium)) xtitle("") ///
					yscale(range(0.3 (.1) .8)) ylab(0.3 (.1) .8, format(%9.1f))
graph display , ysize(1) xsize(1) scale(1) 



